xl: create: close restore_fd_to_close on error
authorIan Campbell <ian.campbell@citrix.com>
Wed, 17 Feb 2016 14:04:15 +0000 (14:04 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 19 Feb 2016 16:03:53 +0000 (16:03 +0000)
commit1a4c97d0403af834eb35c94b01ec73c48a0badb3
tree3e01f93876f34175488ad307655d640fbd22a6c5
parentb4aaf5a72f387c87e50a65224aa4c42ea4f768f6
xl: create: close restore_fd_to_close on error

Currently the fd is opened and then later closed and
restore_fd_to_close set back to -1, however there are several goto out
and goto error_out paths in the interim.

Since the code resets restore_fd_to_close to -1 it is OK to check this
and close on the out path too.

CID: 1055897

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c